package com.jpxx.jpscp.core.common.enums;

/**
 * @Description: 是否状态管理
 * @author: Zhaopengfei
 * @copyright: 金鹏信息技术有限公司
 * @CreatedDate: 2018年04月12日 11:21
 * @Copyright: All rights Reserved，Designed By Jpsycn
 */
public enum IsYesNo {
    YES(1, "是"),
    NO(0, "不是");
    int code;
    String message;

    IsYesNo(int code, String message) {
        this.code = code;
        this.message = message;
    }
    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public static String getValue(Integer status) {
        if (status == null) {
            return "";
        } else {
            for (IsYesNo s : IsYesNo.values()) {
                if (s.getCode() == status) {
                    return s.getMessage();
                }
            }
            return "";
        }
    }
}
